import { registerMicroApps, initGlobalState, start, addGlobalUncaughtErrorHandler  } from "qiankun";
import { initState } from '@store/index.js'
import '@assets/styles/style.css'

addGlobalUncaughtErrorHandler((event) => console.log(event));
registerMicroApps([
    {
      name: "app1",
      entry: "//localhost:1000",
      container: "#root",
      activeRule: "/app1",
      base:'/sub-vue'
    },
    {
      name: "app2",
      entry: "//localhost:2000",
      container: "#j_user",
      activeRule: "/user.html",
    },
  ],
  // life cycle
  {
      beforeLoad: async app => {
        console.log('beforeLoad:', app);
      },
      afterMount: async app => {
       console.log('afterMount', app)
      }
  }
)

start()
initState()